package cn.hdu.liang;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt();
            int count = 0;
            int[] nums = new int[101];
            for(int i = 0; i < n; i++) {
                int t = sc.nextInt();
                if(nums[t] == 0) {
                    nums[t] = 1;
                    count++;
                }
            }

            System.out.println(count);
            for(int i = 0; i < 101; i++) {
                if(nums[i] != 0) {
                    System.out.print(i);
                    if(i < count) {
                        System.out.print(" ");
                    }
                }
            }
        }
    }
}
